import { defineStore } from 'pinia';

interface IState {
	tableRowData: Record<string, any>;
	batchAddData: Array<Record<string, any>>;
	fromPageID: number;
}
export const useCustomTableStore = defineStore('customTable', {
	state: (): IState => ({
		tableRowData: {},
		batchAddData: [], // 批量插入的数据
		fromPageID: -1,
	}),
	actions: {
		setTableRowData(data: Record<string, any>) {
			this.tableRowData = data;
		},
		setBatchAddData(data: Array<Record<string, any>>) {
			this.batchAddData = data;
		},
	},
});
